package com.frxuexi.park2210.adapter

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.lib_base.entity.NewsBeanItem
import com.frxuexi.park2210.R

class NewsAdapter:BaseMultiItemQuickAdapter<NewsBeanItem,BaseViewHolder>() {
    init {
        addItemType(0,R.layout.item_news)
        addItemType(1,R.layout.item_news_right)
    }
    override fun convert(helper: BaseViewHolder, item: NewsBeanItem) {
        if(item.type==0){
            helper.setText(R.id.news_title,item.newsTitle)
            helper.setText(R.id.news_value,item.newsValue)
            helper.setText(R.id.news_time,item.newsTime)
        }else{
            helper.setText(R.id.news_title_right,item.newsTitle)
            helper.setText(R.id.news_value_right,item.newsValue)
            helper.setText(R.id.news_time_right,item.newsTime)
        }
    }
}